/*
 * View.java
 */

package mtvotingserver;

/**
 * @author George Lawie 0401739
 * CM3033 Concurrent Programming, Semester 1 2011/12
 * 
 * View
 * 
 * This class contains strictly only the graphical elements used within the
 * main GUI. All listeners and updates are done in the ViewController class.
 * However, initial values are established upon element creation within this
 * class.
 * 
 * This form was designed using the NetBeans Form Builder, based on the
 * coursework requirements. As such, it contains a lot of generated code.
 * However, most elements have been given human-readable names. A brief
 * description of most elements and their use follows:
 * 
 * leftPanel, rightPanel, buttonPanel, currentLeaderPanel: jPanels used to
 *  conveniently layout further elements.
 * hmPanel1, hmPanel2, etc: jPanels used to group together a text label
 *  and a progress bar for each housemate. This allows easier 'switching on/off'
 *  of a potential housemate's details.
 * hmLabel1, hmLabel2, etc: jLabels with a housemate's name. Tooltips are also 
 *  provided for cases where a housemate has a long name.
 * hmVoteBar1, hmVoteBar2, etc: a jProgressBar that shows the current number of
 *  votes for a housemate, as well as visually showing the current percentage
 *  of the total vote. (This is handled by ViewController.)
 * startButton, stopButton, editButton: self-explanatory jButtons.
 * historyTextArea: Program History, a jTextArea that displays all program
 *  operations from program execution. It is wrapped in a jScrollPane to allow
 *  auto-scrolling.
 * currentLeaderLabel, currentLeaderDescriptionLabel: two text fields, the first
 *  displaying the current leader in a vote, the second displaying a descriptive
 *  label of either "Current Leader" or "Winner".
 * 
 * Getters have been included at the end of the class to allow the view to 
 * access arrays of elements, for further manipulation.
 */
public class View extends javax.swing.JFrame {
    
    /** Creates new form ViewBuilt */
    public View(ServerModel foo) {
        initComponents();
        ServerModel sm = foo;
    }

    /** This method is called from within the constructor to
     * initialize the form.
     * WARNING: Do NOT modify this code. The content of this method is
     * always regenerated by the Form Editor.
     */
    @SuppressWarnings("unchecked")
    // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
    private void initComponents() {

        rightPanel = new javax.swing.JPanel();
        currentLeaderPanel = new javax.swing.JPanel();
        currentLeaderDescriptionLabel = new javax.swing.JLabel();
        currentLeaderLabel = new javax.swing.JLabel();
        buttonPanel = new javax.swing.JPanel();
        editButton = new javax.swing.JButton();
        startButton = new javax.swing.JButton();
        stopButton = new javax.swing.JButton();
        jScrollPane1 = new javax.swing.JScrollPane();
        historyTextArea = new javax.swing.JTextArea();
        leftPanel = new javax.swing.JPanel();
        filler1 = new javax.swing.Box.Filler(new java.awt.Dimension(0, 5), new java.awt.Dimension(0, 5), new java.awt.Dimension(32767, 10));
        hmPanel1 = new javax.swing.JPanel();
        hmLabel1 = new javax.swing.JLabel();
        hmVoteBar1 = new javax.swing.JProgressBar();
        hmPanel2 = new javax.swing.JPanel();
        hmLabel2 = new javax.swing.JLabel();
        hmVoteBar2 = new javax.swing.JProgressBar();
        hmPanel3 = new javax.swing.JPanel();
        hmLabel3 = new javax.swing.JLabel();
        hmVoteBar3 = new javax.swing.JProgressBar();
        hmPanel4 = new javax.swing.JPanel();
        hmLabel4 = new javax.swing.JLabel();
        hmVoteBar4 = new javax.swing.JProgressBar();
        hmPanel5 = new javax.swing.JPanel();
        hmLabel5 = new javax.swing.JLabel();
        hmVoteBar5 = new javax.swing.JProgressBar();
        hmPanel6 = new javax.swing.JPanel();
        hmLabel6 = new javax.swing.JLabel();
        hmVoteBar6 = new javax.swing.JProgressBar();
        hmPanel7 = new javax.swing.JPanel();
        hmLabel7 = new javax.swing.JLabel();
        hmVoteBar7 = new javax.swing.JProgressBar();
        hmPanel8 = new javax.swing.JPanel();
        hmLabel8 = new javax.swing.JLabel();
        hmVoteBar8 = new javax.swing.JProgressBar();
        hmPanel9 = new javax.swing.JPanel();
        hmLabel9 = new javax.swing.JLabel();
        hmVoteBar9 = new javax.swing.JProgressBar();
        hmPanel10 = new javax.swing.JPanel();
        hmLabel10 = new javax.swing.JLabel();
        hmVoteBar10 = new javax.swing.JProgressBar();

        setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE);
        setTitle("Big Brother Voting Admin");
        setCursor(new java.awt.Cursor(java.awt.Cursor.DEFAULT_CURSOR));
        setResizable(false);

        currentLeaderPanel.setBackground(new java.awt.Color(250, 250, 250));

        currentLeaderDescriptionLabel.setHorizontalAlignment(javax.swing.SwingConstants.CENTER);
        currentLeaderDescriptionLabel.setText("Current Leader");

        currentLeaderLabel.setFont(new java.awt.Font("Tahoma", 1, 14)); // NOI18N
        currentLeaderLabel.setForeground(new java.awt.Color(255, 0, 0));
        currentLeaderLabel.setHorizontalAlignment(javax.swing.SwingConstants.CENTER);
        currentLeaderLabel.setText("n/a");

        javax.swing.GroupLayout currentLeaderPanelLayout = new javax.swing.GroupLayout(currentLeaderPanel);
        currentLeaderPanel.setLayout(currentLeaderPanelLayout);
        currentLeaderPanelLayout.setHorizontalGroup(
            currentLeaderPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, currentLeaderPanelLayout.createSequentialGroup()
                .addContainerGap()
                .addGroup(currentLeaderPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
                    .addComponent(currentLeaderLabel, javax.swing.GroupLayout.Alignment.LEADING, javax.swing.GroupLayout.DEFAULT_SIZE, 388, Short.MAX_VALUE)
                    .addComponent(currentLeaderDescriptionLabel, javax.swing.GroupLayout.Alignment.LEADING, javax.swing.GroupLayout.DEFAULT_SIZE, 388, Short.MAX_VALUE))
                .addContainerGap())
        );
        currentLeaderPanelLayout.setVerticalGroup(
            currentLeaderPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(currentLeaderPanelLayout.createSequentialGroup()
                .addComponent(currentLeaderDescriptionLabel)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(currentLeaderLabel, javax.swing.GroupLayout.DEFAULT_SIZE, 17, Short.MAX_VALUE)
                .addContainerGap())
        );

        editButton.setText("Edit Housemates");
        editButton.setEnabled(false);
        editButton.setMaximumSize(new java.awt.Dimension(40, 23));
        editButton.setMinimumSize(new java.awt.Dimension(40, 23));

        startButton.setText("Start Voting");
        startButton.setEnabled(false);
        startButton.setMaximumSize(new java.awt.Dimension(40, 23));
        startButton.setMinimumSize(new java.awt.Dimension(40, 23));

        stopButton.setText("Stop Voting");
        stopButton.setEnabled(false);
        stopButton.setMaximumSize(new java.awt.Dimension(40, 23));
        stopButton.setMinimumSize(new java.awt.Dimension(40, 23));

        javax.swing.GroupLayout buttonPanelLayout = new javax.swing.GroupLayout(buttonPanel);
        buttonPanel.setLayout(buttonPanelLayout);
        buttonPanelLayout.setHorizontalGroup(
            buttonPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(buttonPanelLayout.createSequentialGroup()
                .addComponent(editButton, javax.swing.GroupLayout.PREFERRED_SIZE, 132, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(startButton, javax.swing.GroupLayout.PREFERRED_SIZE, 132, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(stopButton, javax.swing.GroupLayout.PREFERRED_SIZE, 132, javax.swing.GroupLayout.PREFERRED_SIZE))
        );
        buttonPanelLayout.setVerticalGroup(
            buttonPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(buttonPanelLayout.createSequentialGroup()
                .addGroup(buttonPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(editButton, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(startButton, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(stopButton, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
        );

        historyTextArea.setColumns(20);
        historyTextArea.setEditable(false);
        historyTextArea.setRows(5);
        jScrollPane1.setViewportView(historyTextArea);

        javax.swing.GroupLayout rightPanelLayout = new javax.swing.GroupLayout(rightPanel);
        rightPanel.setLayout(rightPanelLayout);
        rightPanelLayout.setHorizontalGroup(
            rightPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, rightPanelLayout.createSequentialGroup()
                .addContainerGap()
                .addGroup(rightPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
                    .addComponent(jScrollPane1, javax.swing.GroupLayout.Alignment.LEADING, javax.swing.GroupLayout.DEFAULT_SIZE, 408, Short.MAX_VALUE)
                    .addComponent(buttonPanel, javax.swing.GroupLayout.Alignment.LEADING, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                    .addComponent(currentLeaderPanel, javax.swing.GroupLayout.Alignment.LEADING, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
                .addContainerGap())
        );
        rightPanelLayout.setVerticalGroup(
            rightPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(rightPanelLayout.createSequentialGroup()
                .addContainerGap()
                .addComponent(buttonPanel, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(currentLeaderPanel, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                .addComponent(jScrollPane1, javax.swing.GroupLayout.DEFAULT_SIZE, 238, Short.MAX_VALUE)
                .addContainerGap())
        );

        leftPanel.setLayout(new java.awt.GridLayout(11, 1));
        leftPanel.add(filler1);

        hmPanel1.setOpaque(false);

        hmLabel1.setText("Housemate 1");

        hmVoteBar1.setString("Waiting...");
        hmVoteBar1.setStringPainted(true);

        javax.swing.GroupLayout hmPanel1Layout = new javax.swing.GroupLayout(hmPanel1);
        hmPanel1.setLayout(hmPanel1Layout);
        hmPanel1Layout.setHorizontalGroup(
            hmPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(hmPanel1Layout.createSequentialGroup()
                .addContainerGap()
                .addComponent(hmLabel1, javax.swing.GroupLayout.PREFERRED_SIZE, 63, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                .addComponent(hmVoteBar1, javax.swing.GroupLayout.PREFERRED_SIZE, 230, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addContainerGap())
        );
        hmPanel1Layout.setVerticalGroup(
            hmPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(hmPanel1Layout.createSequentialGroup()
                .addGroup(hmPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addComponent(hmLabel1)
                    .addComponent(hmVoteBar1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addContainerGap(15, Short.MAX_VALUE))
        );

        hmPanel1.setVisible(false);

        leftPanel.add(hmPanel1);

        hmPanel2.setOpaque(false);

        hmLabel2.setText("Housemate 2");

        hmVoteBar2.setString("Waiting...");
        hmVoteBar2.setStringPainted(true);

        javax.swing.GroupLayout hmPanel2Layout = new javax.swing.GroupLayout(hmPanel2);
        hmPanel2.setLayout(hmPanel2Layout);
        hmPanel2Layout.setHorizontalGroup(
            hmPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(hmPanel2Layout.createSequentialGroup()
                .addContainerGap()
                .addComponent(hmLabel2, javax.swing.GroupLayout.PREFERRED_SIZE, 63, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                .addComponent(hmVoteBar2, javax.swing.GroupLayout.PREFERRED_SIZE, 230, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addContainerGap())
        );
        hmPanel2Layout.setVerticalGroup(
            hmPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(hmPanel2Layout.createSequentialGroup()
                .addGroup(hmPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addComponent(hmLabel2)
                    .addComponent(hmVoteBar2, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addContainerGap(15, Short.MAX_VALUE))
        );

        hmPanel2.setVisible(false);

        leftPanel.add(hmPanel2);

        hmPanel3.setOpaque(false);

        hmLabel3.setText("Housemate 3");

        hmVoteBar3.setString("Waiting...");
        hmVoteBar3.setStringPainted(true);

        javax.swing.GroupLayout hmPanel3Layout = new javax.swing.GroupLayout(hmPanel3);
        hmPanel3.setLayout(hmPanel3Layout);
        hmPanel3Layout.setHorizontalGroup(
            hmPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(hmPanel3Layout.createSequentialGroup()
                .addContainerGap()
                .addComponent(hmLabel3, javax.swing.GroupLayout.PREFERRED_SIZE, 63, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                .addComponent(hmVoteBar3, javax.swing.GroupLayout.PREFERRED_SIZE, 230, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addContainerGap())
        );
        hmPanel3Layout.setVerticalGroup(
            hmPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(hmPanel3Layout.createSequentialGroup()
                .addGroup(hmPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addComponent(hmLabel3)
                    .addComponent(hmVoteBar3, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addContainerGap(15, Short.MAX_VALUE))
        );

        hmPanel3.setVisible(false);

        leftPanel.add(hmPanel3);

        hmPanel4.setOpaque(false);

        hmLabel4.setText("Housemate 4");

        hmVoteBar4.setString("Waiting...");
        hmVoteBar4.setStringPainted(true);

        javax.swing.GroupLayout hmPanel4Layout = new javax.swing.GroupLayout(hmPanel4);
        hmPanel4.setLayout(hmPanel4Layout);
        hmPanel4Layout.setHorizontalGroup(
            hmPanel4Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(hmPanel4Layout.createSequentialGroup()
                .addContainerGap()
                .addComponent(hmLabel4, javax.swing.GroupLayout.PREFERRED_SIZE, 63, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                .addComponent(hmVoteBar4, javax.swing.GroupLayout.PREFERRED_SIZE, 230, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addContainerGap())
        );
        hmPanel4Layout.setVerticalGroup(
            hmPanel4Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(hmPanel4Layout.createSequentialGroup()
                .addGroup(hmPanel4Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addComponent(hmLabel4)
                    .addComponent(hmVoteBar4, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addContainerGap(15, Short.MAX_VALUE))
        );

        hmPanel4.setVisible(false);

        leftPanel.add(hmPanel4);

        hmPanel5.setOpaque(false);

        hmLabel5.setText("Housemate 5");

        hmVoteBar5.setString("Waiting...");
        hmVoteBar5.setStringPainted(true);

        javax.swing.GroupLayout hmPanel5Layout = new javax.swing.GroupLayout(hmPanel5);
        hmPanel5.setLayout(hmPanel5Layout);
        hmPanel5Layout.setHorizontalGroup(
            hmPanel5Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(hmPanel5Layout.createSequentialGroup()
                .addContainerGap()
                .addComponent(hmLabel5, javax.swing.GroupLayout.PREFERRED_SIZE, 63, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                .addComponent(hmVoteBar5, javax.swing.GroupLayout.PREFERRED_SIZE, 230, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addContainerGap())
        );
        hmPanel5Layout.setVerticalGroup(
            hmPanel5Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(hmPanel5Layout.createSequentialGroup()
                .addGroup(hmPanel5Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addComponent(hmLabel5)
                    .addComponent(hmVoteBar5, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addContainerGap(15, Short.MAX_VALUE))
        );

        hmPanel5.setVisible(false);

        leftPanel.add(hmPanel5);

        hmPanel6.setOpaque(false);

        hmLabel6.setText("Housemate 6");

        hmVoteBar6.setString("Waiting...");
        hmVoteBar6.setStringPainted(true);

        javax.swing.GroupLayout hmPanel6Layout = new javax.swing.GroupLayout(hmPanel6);
        hmPanel6.setLayout(hmPanel6Layout);
        hmPanel6Layout.setHorizontalGroup(
            hmPanel6Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(hmPanel6Layout.createSequentialGroup()
                .addContainerGap()
                .addComponent(hmLabel6, javax.swing.GroupLayout.PREFERRED_SIZE, 63, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                .addComponent(hmVoteBar6, javax.swing.GroupLayout.PREFERRED_SIZE, 230, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addContainerGap())
        );
        hmPanel6Layout.setVerticalGroup(
            hmPanel6Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(hmPanel6Layout.createSequentialGroup()
                .addGroup(hmPanel6Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addComponent(hmLabel6)
                    .addComponent(hmVoteBar6, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addContainerGap(15, Short.MAX_VALUE))
        );

        hmPanel6.setVisible(false);

        leftPanel.add(hmPanel6);

        hmPanel7.setOpaque(false);

        hmLabel7.setText("Housemate 7");

        hmVoteBar7.setString("Waiting...");
        hmVoteBar7.setStringPainted(true);

        javax.swing.GroupLayout hmPanel7Layout = new javax.swing.GroupLayout(hmPanel7);
        hmPanel7.setLayout(hmPanel7Layout);
        hmPanel7Layout.setHorizontalGroup(
            hmPanel7Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(hmPanel7Layout.createSequentialGroup()
                .addContainerGap()
                .addComponent(hmLabel7, javax.swing.GroupLayout.PREFERRED_SIZE, 63, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                .addComponent(hmVoteBar7, javax.swing.GroupLayout.PREFERRED_SIZE, 230, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addContainerGap())
        );
        hmPanel7Layout.setVerticalGroup(
            hmPanel7Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(hmPanel7Layout.createSequentialGroup()
                .addGroup(hmPanel7Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addComponent(hmLabel7)
                    .addComponent(hmVoteBar7, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addContainerGap(15, Short.MAX_VALUE))
        );

        hmPanel7.setVisible(false);

        leftPanel.add(hmPanel7);

        hmPanel8.setOpaque(false);

        hmLabel8.setText("Housemate 8");

        hmVoteBar8.setString("Waiting...");
        hmVoteBar8.setStringPainted(true);

        javax.swing.GroupLayout hmPanel8Layout = new javax.swing.GroupLayout(hmPanel8);
        hmPanel8.setLayout(hmPanel8Layout);
        hmPanel8Layout.setHorizontalGroup(
            hmPanel8Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(hmPanel8Layout.createSequentialGroup()
                .addContainerGap()
                .addComponent(hmLabel8, javax.swing.GroupLayout.PREFERRED_SIZE, 63, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                .addComponent(hmVoteBar8, javax.swing.GroupLayout.PREFERRED_SIZE, 230, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addContainerGap())
        );
        hmPanel8Layout.setVerticalGroup(
            hmPanel8Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(hmPanel8Layout.createSequentialGroup()
                .addGroup(hmPanel8Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addComponent(hmLabel8)
                    .addComponent(hmVoteBar8, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addContainerGap(15, Short.MAX_VALUE))
        );

        hmPanel8.setVisible(false);

        leftPanel.add(hmPanel8);

        hmPanel9.setOpaque(false);

        hmLabel9.setText("Housemate 9");

        hmVoteBar9.setString("Waiting...");
        hmVoteBar9.setStringPainted(true);

        javax.swing.GroupLayout hmPanel9Layout = new javax.swing.GroupLayout(hmPanel9);
        hmPanel9.setLayout(hmPanel9Layout);
        hmPanel9Layout.setHorizontalGroup(
            hmPanel9Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(hmPanel9Layout.createSequentialGroup()
                .addContainerGap()
                .addComponent(hmLabel9, javax.swing.GroupLayout.PREFERRED_SIZE, 63, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                .addComponent(hmVoteBar9, javax.swing.GroupLayout.PREFERRED_SIZE, 230, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addContainerGap())
        );
        hmPanel9Layout.setVerticalGroup(
            hmPanel9Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(hmPanel9Layout.createSequentialGroup()
                .addGroup(hmPanel9Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addComponent(hmLabel9)
                    .addComponent(hmVoteBar9, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addContainerGap(15, Short.MAX_VALUE))
        );

        hmPanel9.setVisible(false);

        leftPanel.add(hmPanel9);

        hmPanel10.setOpaque(false);

        hmLabel10.setText("Housemate X");

        hmVoteBar10.setString("Waiting...");
        hmVoteBar10.setStringPainted(true);

        javax.swing.GroupLayout hmPanel10Layout = new javax.swing.GroupLayout(hmPanel10);
        hmPanel10.setLayout(hmPanel10Layout);
        hmPanel10Layout.setHorizontalGroup(
            hmPanel10Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(hmPanel10Layout.createSequentialGroup()
                .addContainerGap()
                .addComponent(hmLabel10, javax.swing.GroupLayout.PREFERRED_SIZE, 63, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                .addComponent(hmVoteBar10, javax.swing.GroupLayout.PREFERRED_SIZE, 230, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addContainerGap())
        );
        hmPanel10Layout.setVerticalGroup(
            hmPanel10Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(hmPanel10Layout.createSequentialGroup()
                .addGroup(hmPanel10Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addComponent(hmLabel10)
                    .addComponent(hmVoteBar10, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addContainerGap(15, Short.MAX_VALUE))
        );

        hmPanel10.setVisible(false);

        leftPanel.add(hmPanel10);

        javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane());
        getContentPane().setLayout(layout);
        layout.setHorizontalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(layout.createSequentialGroup()
                .addComponent(leftPanel, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(rightPanel, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
        );
        layout.setVerticalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addComponent(leftPanel, javax.swing.GroupLayout.DEFAULT_SIZE, 359, Short.MAX_VALUE)
            .addComponent(rightPanel, javax.swing.GroupLayout.Alignment.TRAILING, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
        );

        pack();
    }// </editor-fold>//GEN-END:initComponents
    
    // Various getters to allow the ViewController to safely access elements
    public javax.swing.JPanel[] getPanels() {
        javax.swing.JPanel[] panels = new javax.swing.JPanel[10];
        panels[0] = hmPanel1;
        panels[1] = hmPanel2;
        panels[2] = hmPanel3;
        panels[3] = hmPanel4;
        panels[4] = hmPanel5;
        panels[5] = hmPanel6;
        panels[6] = hmPanel7;
        panels[7] = hmPanel8;
        panels[8] = hmPanel9;
        panels[9] = hmPanel10;
        return panels;
    }
    
    public javax.swing.JLabel[] getLabels() {
        javax.swing.JLabel[] labels = new javax.swing.JLabel[10];
        labels[0] = hmLabel1;
        labels[1] = hmLabel2;
        labels[2] = hmLabel3;
        labels[3] = hmLabel4;
        labels[4] = hmLabel5;
        labels[5] = hmLabel6;
        labels[6] = hmLabel7;
        labels[7] = hmLabel8;
        labels[8] = hmLabel9;
        labels[9] = hmLabel10;
        return labels;
    }
    
    public javax.swing.JProgressBar[] getVoteBars() {
        javax.swing.JProgressBar[] voteBars = new javax.swing.JProgressBar[10];
        voteBars[0] = hmVoteBar1;
        voteBars[1] = hmVoteBar2;
        voteBars[2] = hmVoteBar3;
        voteBars[3] = hmVoteBar4;
        voteBars[4] = hmVoteBar5;
        voteBars[5] = hmVoteBar6;
        voteBars[6] = hmVoteBar7;
        voteBars[7] = hmVoteBar8;
        voteBars[8] = hmVoteBar9;
        voteBars[9] = hmVoteBar10;
        return voteBars;
    }
    
    public javax.swing.JButton getStartButton() {
        return startButton;
    }
    
    public javax.swing.JButton getStopButton() {
        return stopButton;
    }
    
    public javax.swing.JButton getEditButton() {
        return editButton;
    }
    
    public javax.swing.JLabel getCurrentLeader() {
        return currentLeaderLabel;
    }
    
    public javax.swing.JLabel getCurrentLeaderDescription() {
        return currentLeaderDescriptionLabel;
    }
    
    public javax.swing.JTextArea getHistory() {
        return historyTextArea;
    }

    // Variables declaration - do not modify//GEN-BEGIN:variables
    private javax.swing.JPanel buttonPanel;
    private javax.swing.JLabel currentLeaderDescriptionLabel;
    private javax.swing.JLabel currentLeaderLabel;
    private javax.swing.JPanel currentLeaderPanel;
    private javax.swing.JButton editButton;
    private javax.swing.Box.Filler filler1;
    private javax.swing.JTextArea historyTextArea;
    private javax.swing.JLabel hmLabel1;
    private javax.swing.JLabel hmLabel10;
    private javax.swing.JLabel hmLabel2;
    private javax.swing.JLabel hmLabel3;
    private javax.swing.JLabel hmLabel4;
    private javax.swing.JLabel hmLabel5;
    private javax.swing.JLabel hmLabel6;
    private javax.swing.JLabel hmLabel7;
    private javax.swing.JLabel hmLabel8;
    private javax.swing.JLabel hmLabel9;
    private javax.swing.JPanel hmPanel1;
    private javax.swing.JPanel hmPanel10;
    private javax.swing.JPanel hmPanel2;
    private javax.swing.JPanel hmPanel3;
    private javax.swing.JPanel hmPanel4;
    private javax.swing.JPanel hmPanel5;
    private javax.swing.JPanel hmPanel6;
    private javax.swing.JPanel hmPanel7;
    private javax.swing.JPanel hmPanel8;
    private javax.swing.JPanel hmPanel9;
    private javax.swing.JProgressBar hmVoteBar1;
    private javax.swing.JProgressBar hmVoteBar10;
    private javax.swing.JProgressBar hmVoteBar2;
    private javax.swing.JProgressBar hmVoteBar3;
    private javax.swing.JProgressBar hmVoteBar4;
    private javax.swing.JProgressBar hmVoteBar5;
    private javax.swing.JProgressBar hmVoteBar6;
    private javax.swing.JProgressBar hmVoteBar7;
    private javax.swing.JProgressBar hmVoteBar8;
    private javax.swing.JProgressBar hmVoteBar9;
    private javax.swing.JScrollPane jScrollPane1;
    private javax.swing.JPanel leftPanel;
    private javax.swing.JPanel rightPanel;
    private javax.swing.JButton startButton;
    private javax.swing.JButton stopButton;
    // End of variables declaration//GEN-END:variables
}
